import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

/* Layout */
import Layout from "@/layout";

/**
 * Note: 路由配置项
 *
 * hidden: true                     // 当设置 true 的时候该路由不会再侧边栏出现 如401，login等页面，或者如一些编辑页面/edit/1
 * alwaysShow: true                 // 当你一个路由下面的 children 声明的路由大于1个时，自动会变成嵌套的模式--如组件页面
 *                                  // 只有一个时，会将那个子路由当做根路由显示在侧边栏--如引导页面
 *                                  // 若你想不管路由下面的 children 声明的个数都显示你的根路由
 *                                  // 你可以设置 alwaysShow: true，这样它就会忽略之前定义的规则，一直显示根路由
 * redirect: noRedirect             // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
 * name:'router-name'               // 设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题
 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
 * meta : {
    noCache: true                   // 如果设置为true，则不会被 <keep-alive> 缓存(默认 false)
    title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
    icon: 'svg-name'                // 设置该路由的图标，对应路径src/assets/icons/svg
    breadcrumb: false               // 如果设置为false，则不会在breadcrumb面包屑中显示
    activeMenu: '/system/user'      // 当路由设置了该属性，则会高亮相对应的侧边栏。
  }
 */

// 公共路由
export const constantRoutes = [
  {
    path: "/redirect",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/redirect/:path(.*)",
        component: (resolve) => require(["@/views/redirect"], resolve),
      },
    ],
  },
  {
    path: "/login",
    component: (resolve) => require(["@/views/login"], resolve),
    hidden: true,
  },
  {
    path: "/daping",
    component: (resolve) => require(["@/views/daping"], resolve),
    hidden: true,
  },
  {
    path: "/index_quick",
    component: (resolve) => require(["@/views/index_quick"], resolve),
    hidden: true,
  },
  {
    path: "/register",
    component: (resolve) => require(["@/views/register"], resolve),
    hidden: true,
  },
  {
    path: "/pdf",
    component: (resolve) => require(["@/components/MmvNotify/pdf/index"], resolve),
    hidden: true,
  },
  {
    path: "/404",
    component: (resolve) => require(["@/views/error/404"], resolve),
    hidden: true,
  },
  {
    path: "/401",
    component: (resolve) => require(["@/views/error/401"], resolve),
    hidden: true,
  },
  {
    path: "/newPing",
    component: (resolve) => require(["@/components/china/index.vue"], resolve),
    hidden: true,
  },

  {
    path: "",
    component: Layout,
    redirect: "index",
    children: [
      {
        path: "index",
        component: (resolve) => require(["@/views/index"], resolve),
        name: "Index",
        meta: { title: "工作台", icon: "dz-kzt-icon", affix: true, keepAlive: true },
      },
    ],
  },
  {
    // OTA调价
    path: "/system",
    component: Layout,
    // redirect: "noredirect",
    hidden: true,
    children: [
      {
        path: "ota/OTAPriceUpdateList/add",
        component: (resolve) =>
          require(["@/views/system/otaPriceUpdate/add"], resolve),
        name: "OtaPriceUpdateAdd",
        meta: { title: "ota手动调价"},
      },
      {
        path: "ota/OTAPriceUpdateList/detail",
        component: (resolve) =>
          require(["@/views/system/otaPriceUpdate/detail"], resolve),
        name: "OtaPriceUpdateDetail",
        meta: { title: "调价详情"},
      }
    ]
  },
  {
    // 日租订单
    path: "/orderBasic",
    component: Layout,
    // redirect: "noredirect",
    hidden: true,
    children: [
      {
        path: "add",
        component: (resolve) =>
          require(["@/views/order/orderBasic/add"], resolve),
        name: "OrderBasicAdd",
        meta: { title: "日租订单新增", activeMenu: "/order/order" },
      },
      {
        path: "edit",
        component: (resolve) =>
          require(["@/views/order/orderBasic/add"], resolve),
        name: "OrderBasicAdd",
        meta: { title: "日租订单修改", activeMenu: "/order/order" },
      },
      {
        path: "detail",
        component: (resolve) =>
          require(["@/views/order/orderBasic/detail"], resolve),
        name: "OrderbasicDetail",
        meta: { title: "日租订单详情", activeMenu: "/order/order" },
      },
      {
        path: "otaOrderDetail",
        component: (resolve) =>
          require(["@/views/order/orderBasic/otaOrderDetail"], resolve),
        name: "otaOrderDetail",
        meta: { title: "OTA订单详情", activeMenu: "/order/order" },
      },

      {
        path: "delivery",
        component: (resolve) =>
          require(["@/views/order/orderBasic/delivery"], resolve),
        name: "Delivery",
        meta: { title: "验车单", activeMenu: "/order/order" },
      },
      {
        path: "otaDelivery",
        component: (resolve) =>
          require(["@/views/order/orderBasic/otaDelivery"], resolve),
        name: "otaDelivery",
        meta: { title: "ota验车单", activeMenu: "/order/order" },
      },
      {
        path: "returnTheCar",
        component: (resolve) =>
          require(["@/views/order/orderBasic/delivery"], resolve),
        name: "Delivery",
        meta: { title: "验车单", activeMenu: "/order/order" },
      },
      {
        path: "orderPayRecord",
        component: (resolve) =>
          require(["@/views/order/orderBasic/orderPayRecord"], resolve),
        name: "OrderPayRecord",
        meta: { title: "费用缴纳", activeMenu: "/order/order" },
      },
      {
        path: "earlyReturn",
        component: (resolve) =>
          require(["@/views/order/orderBasic/earlyReturn"], resolve),
        name: "EarlyReturn",
        meta: { title: "提前还车", activeMenu: "/order/order" },
      },
      {
        path: "changeCar",
        component: (resolve) =>
          require(["@/views/order/orderBasic/changeCar"], resolve),
        name: "ChangeCar",
        meta: { title: "订单换车", activeMenu: "/order/order" },
      },
      {
        path: "otaCostAdditional",
        component: (resolve) =>
          require(["@/views/order/orderBasic/otaCostAdditional"], resolve),
        name: "OtaCostAdditional",
        meta: { title: "费用补录", activeMenu: "/order/order" },
      },
    ],
  },
  {
    // 月租订单
    path: "/longBasic",
    component: Layout,
    // redirect: "noredirect",
    hidden: true,
    children: [
      {
        path: "detail",
        component: (resolve) =>
          require(["@/views/longOrder/basic/detail"], resolve),
        name: "LongOrderbasicDetail",
        meta: { title: "月租订单详情", activeMenu: "/longOrder/order" },
      },
    ],
  },
  {
    // 包车订单
    path: "/charteredBus/order",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "addOrder",
        component: (resolve) =>
          require(["@/views/charteredBus/order/addOrder"], resolve),
        name: "AddCharterOrder",
        meta: { title: "包车新增订单", activeMenu: "" },
      },
      {
        path: "detail",
        component: (resolve) =>
          require(["@/views/charteredBus/order/detail"], resolve),
        name: "CharteredBusDetail",
        meta: { title: "包车订单详情", activeMenu: "" },
      },
      {
        path: "delivery",
        component: (resolve) =>
          require(["@/views/charteredBus/order/delivery"], resolve),
        name: "CharteredBusDelivery",
        meta: { title: "包车验车", activeMenu: "" },
      }
    ],
  },
  {
    // 车辆列表
    path: "/basic",
    component: Layout,
    redirect: "noredirect",
    hidden: true,
    children: [
      {
        path: "add",
        component: (resolve) =>
          require(["@/views/car/basic/car_save"], resolve),
        name: "basic_add",
        meta: { title: "车辆列表新增", icon: "basic" },
      },
      {
        path: "edit",
        component: (resolve) =>
          require(["@/views/car/basic/car_edit"], resolve),
        name: "basic_edit",
        meta: { title: "车辆列表修改", icon: "basic" },
      },
      {
        path: "detail",
        component: (resolve) => require(["@/views/car/basic/detail"], resolve),
        name: "basic_detail",
        meta: { title: "车辆列表详情", icon: "basic" },
      },
    ],
  },
  {
    // 车辆处置
    path: "/management",
    component: Layout,
    redirect: "noredirect",
    hidden: true,
    children: [
      {
        path: "detail",
        component: (resolve) =>
          require(["@/views/car/management/detail"], resolve),
        name: "management_detail",
        meta: { title: "车辆处置查看", icon: "management" },
      },
    ],
  },
  {
    // 车辆违章
    path: "/illegal",
    component: Layout,
    redirect: "noredirect",
    hidden: true,
    children: [
      {
        path: "add",
        component: (resolve) => require(["@/views/car/illegal/add"], resolve),
        name: "illegal_add",
        meta: { title: "车辆违章新增", icon: "illegal", activeMenu: "/car/illegal" },
      },
      {
        path: "edit",
        component: (resolve) => require(["@/views/car/illegal/add"], resolve),
        name: "illegal_edit",
        meta: { title: "车辆违章修改", icon: "illegal", activeMenu: "/car/illegal" },
      },
      {
        path: "detail",
        component: (resolve) => require(["@/views/car/illegal/info"], resolve),
        name: "illegal_detail",
        meta: { title: "车辆违章详情", icon: "illegal", activeMenu: "/car/illegal" },
      },
      {
        path: "batchqueryIllegal",
        component: (resolve) =>
          require(["@/views/car/illegal/batchqueryIllegal"], resolve),
        name: "illegal",
        meta: { title: "违章查询", activeMenu: "/car/illegal" },
      },

    ],
  },

  {
    path: "/user",
    component: Layout,
    hidden: true,
    redirect: "noredirect",
    children: [
      {
        path: "profile",
        component: (resolve) =>
          require(["@/views/system/user/profile/index"], resolve),
        name: "Profile",
        meta: { title: "个人中心", icon: "user" },
      },
    ],
  },
  {
    path: "/member",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "detail",
        component: (resolve) => require(["@/views/member/detail"], resolve),
        name: "member_detail",
        meta: { title: "客户列表详情", icon: "member" },
      },
      {
        path: "channelStatistics",
        component: (resolve) => require(["@/views/member/channelStatistics"], resolve),
        name: "member_channelStatistics",
        meta: { title: "渠道转化统计", icon: "member" },
      },
    ],
  },
  {
    path: "/pdf",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "index",
        component: (resolve) => require(["@/components/MmvNotify/pdf/index"], resolve),
        name: "pdf",
        meta: { title: "操作指南", icon: "pdf" },
      },
      {
        path: "detail",
        component: (resolve) => require(["@/components/MmvNotify/pdf/detail"], resolve),
        name: "pdf",
        meta: { title: "行知操作说明文档", icon: "pdf" },
      },
    ],
  },
  {
    path: "/marketingManagement",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "couponManage/add",
        component: (resolve) =>
          require(["@/views/marketingManagement/couponManage/add"], resolve),
        name: "marketingManagement",
        meta: { title: "新增优惠券" },
      },
    ],
  },
  {
    path: "/system",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "template/add",
        component: (resolve) =>
          require(["@/views/system/template/add"], resolve),
        name: "system",
        meta: { title: "新增活动模板" },
      },
    ],
  },

  {
    path: "/map-track",
    component: (resolve) =>
      require(["@/views/car/vehiclemonitoringpage/guiji"], resolve),
    hidden: true,
    meta: { title: "车辆轨迹" },
  },
  {
    path: "/map-trace",
    component: (resolve) =>
      require(["@/views/car/vehiclemonitoringpage/trace"], resolve),
    hidden: true,
    meta: { title: "实时跟踪" },
  },
  {
    path: "/contract",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "showContract/:id",
        component: (resolve) =>
          require(["@/views/contract/showContract"], resolve),
        name: "contract",
        meta: { title: "合同模板查看" },
      },
    ],
  },
  {
    path: "/order",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "orderBasic/showContract/:url/:orderNo",
        component: (resolve) =>
          require(["@/views/order/orderBasic/showContract"], resolve),
        name: "orderBasic",
        meta: { title: "订单合同查看" },
      },
    ],
  },
  {
    path: "/contract",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "editContract/:id",
        component: (resolve) =>
          require(["@/views/contract/editContract"], resolve),
        name: "contract",
        meta: { title: "合同模板编辑" },
      },
    ],
  },
  {
    path: "/tenantCenter/user-auth",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "role/:userId(\\d+)",
        component: (resolve) =>
          require(["@/views/system/user/authRole"], resolve),
        name: "AuthRole",
        meta: { title: "分配角色", activeMenu: "/tenantCenter/jichu/user" },
      },
    ],
  },
  {
    path: "/tenantCenter/addUser",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "add",
        component: (resolve) =>
          require(["@/views/system/user/addUser"], resolve),
        name: "SystemUserAddUser",
        meta: { title: "添加用户", activeMenu: "/tenantCenter/jichu/user" },
      },
      {
        path: "update/:userId",
        component: (resolve) =>
          require(["@/views/system/user/addUser"], resolve),
        name: "SystemUserUpdateUser",
        meta: { title: "修改用户", activeMenu: "/tenantCenter/jichu/user" },
      },
    ],
  },
  {
    path: "/charteredBus/addDriver",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "add",
        component: (resolve) =>
          require(["@/views/system/driver/addDriver"], resolve),
        name: "SystemUserAddDriver",
        meta: { title: "添加司机", activeMenu: "/charteredBus/driver/driver" },
      },
      {
        path: "update/:userId",
        component: (resolve) =>
          require(["@/views/system/driver/addDriver"], resolve),
        name: "SystemUserUpdateDriver",
        meta: { title: "修改司机", activeMenu: "/charteredBus/driver/driver" },
      },
    ],
  },




  {
    path: "/tenantCenter/addRole",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "add",
        component: (resolve) =>
          require(["@/views/system/role/addRole"], resolve),
        name: "SystemRoleAddUser",
        meta: { title: "添加角色", activeMenu: "/tenantCenter/role" },
      },
      {
        path: "update/:roleId",
        component: (resolve) =>
          require(["@/views/system/role/addRole"], resolve),
        name: "SystemRoleUpdateUser",
        meta: { title: "修改角色", activeMenu: "/tenantCenter/role" },
      },
    ],
  },
  {
    path: "/tenantCenter/role-auth",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "user/:roleId(\\d+)",
        component: (resolve) =>
          require(["@/views/system/role/authUser"], resolve),
        name: "AuthUser",
        meta: { title: "分配用户", activeMenu: "/system/role" },
      },
    ],
  },
  {
    // 门店列表
    path: "/tenantCenter/store",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "add",
        component: (resolve) =>
          require(["@/views/store/add"], resolve),
        name: "storeAdd",
        meta: { title: "门店列表新增", activeMenu: "/tenantCenter/jichu/store" },
      },
      {
        path: "edit",
        component: (resolve) =>
          require(["@/views/store/add"], resolve),
        name: "storeEdit",
        meta: { title: "门店列表编辑", activeMenu: "/tenantCenter/jichu/store" },
      },
      {
        path: "detail",
        component: (resolve) =>
          require(["@/views/store/detail"], resolve),
        name: "storeDetail",
        meta: { title: "门店列表详情", activeMenu: "/tenantCenter/jichu/store" },
      },
    ],
  },
  {
    path: "/system/dict-data",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "index/:dictId(\\d+)",
        component: (resolve) => require(["@/views/system/dict/data"], resolve),
        name: "Data",
        meta: { title: "字典数据", activeMenu: "/system/dict" },
      },
    ],
  },
  {
    path: "/monitor/job-log",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "index",
        component: (resolve) => require(["@/views/monitor/job/log"], resolve),
        name: "JobLog",
        meta: { title: "调度日志", activeMenu: "/monitor/job" },
      },
    ],
  },
  {
    path: "/tool/gen-edit",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "index",
        component: (resolve) =>
          require(["@/views/tool/gen/editTable"], resolve),
        name: "GenEdit",
        meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
      },
    ],
  },

  // 活动订单
  {
    path: "/order",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/order/activity/detail/:id",
        component: (resolve) =>
          require(["@/views/order/activity/child/detail"], resolve),
        name: "ActivityDetil",
        meta: { title: "查看活动订单详情", activeMenu: "/order/orderActivity" },
      },
      {
        path: "/order/writeoff/detail/:id",
        component: (resolve) =>
          require(["@/views/order/writeoff/child/detail"], resolve),
        name: "WriteoffDetil",
        meta: {
          title: "查看活动订单核销详情",
          activeMenu: "/order/orderWriteoff",
        },
      },
    ],
  },
  {
    // 活动订单
    path: "/finance",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/finance/activity/detail/:id",
        component: (resolve) =>
          require(["@/views/finance/activity/child/detail"], resolve),
        name: "ActivityDetil",
        meta: { title: "查看活动流水详情", activeMenu: "/finance/activity" },
      },
    ],
  },
  //营销活动管理
  {
    path: "/marketingManagement/activityManage",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/activityManage/add",
        component: (resolve) =>
          require([
            "@/views/marketingManagement/activityManage/child/add",
          ], resolve),
        name: "activityManageAdd",
        meta: {
          title: "新增营销活动",
          activeMenu: "/marketingManagement/activityManage",
        },
      },
      {
        path: "/activityManage/edit",
        component: (resolve) =>
          require([
            "@/views/marketingManagement/activityManage/child/add",
          ], resolve),
        name: "activityManageEdit",
        meta: {
          title: "编辑营销活动",
          activeMenu: "/marketingManagement/activityManage",
        },
      },
      {
        path: "/activityManage/info",
        component: (resolve) =>
          require([
            "@/views/marketingManagement/activityManage/child/info",
          ], resolve),
        name: "activityManageInfo",
        meta: {
          title: "营销活动详情",
          activeMenu: "/marketingManagement/activityManage",
        },
      },
      {
        path: "/activityManage/activityData",
        component: (resolve) =>
          require([
            "@/views/marketingManagement/activityManage/child/activityData",
          ], resolve),
        name: "activityManageData",
        meta: {
          title: "营销活动数据",
          activeMenu: "/marketingManagement/activityManage",
        },
      },
      {
        path: "/activityManage/historical",
        component: (resolve) =>
          require([
            "@/views/marketingManagement/historicalActivities/index",
          ], resolve),
        name: "historicalActivities",
        meta: {
          title: "历史活动",
          activeMenu: "/marketingManagement/activityManage",
        },
      },
    ],
  },

  {
    //分销伙伴
    path: "/market",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/market/marketing/basic/detail",
        component: (resolve) =>
          require(["@/views/marketing/customer/detail"], resolve),
        name: "customerBasicDetail",
        meta: { title: "分销伙伴详情", activeMenu: "/market/marketing/basic" },
      },
      {
        path: "/market/marketing/basic/downDetail",
        component: (resolve) =>
          require(["@/views/marketing/customer/downDetail"], resolve),
        name: "customerBasicDownDetail",
        meta: {
          title: "下级分销伙伴详情",
          activeMenu: "/market/marketing/basic",
        },
      },
    ],
  },
  {
    //小程序运营
    path: "/plan",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/plan/newPlan/detail",
        component: (resolve) =>
          require(["@/views/plan/newPlan/detail"], resolve),
        name: "newPlanDetail",
        meta: {
          title: "小程序运营详情",
          activeMenu: "/tenantCenter/yewu/plan",
        },
      },
      {
        path: "add",
        component: (resolve) =>
          require(["@/views/plan/newPlan/add"], resolve),
        name: "PlanAdd",
        meta: { title: "新增车价", activeMenu: "/plan/add" },
      },
      {
        path: "edit",
        component: (resolve) =>
          require(["@/views/plan/newPlan/add"], resolve),
        name: "PlanEdit",
        meta: { title: "编辑车价", activeMenu: "/plan/edit" },
      },
      {
        path: "detail",
        component: (resolve) =>
          require(["@/views/plan/newPlan/detail"], resolve),
        name: "PlanDetail",
        meta: { title: "车价详情", activeMenu: "/plan/detail" },
      },
    ],
  },

  {
    //包车
    path: "/charteredBus/priceSet",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "add",
        component: (resolve) =>
          require(["@/views/charteredBus/priceSetting/add"], resolve),
        name: "priceSettingAdd",
        meta: { title: "新增包车价格设置", activeMenu: "/charteredBus/priceSetting" },
      },
      {
        path: "edit",
        component: (resolve) =>
          require(["@/views/charteredBus/priceSetting/add"], resolve),
        name: "priceSettingEdit",
        meta: { title: "编辑包车价格设置", activeMenu: "/charteredBus/priceSetting" },
      },
      {
        path: "detail",
        component: (resolve) =>
          require(["@/views/charteredBus/priceSetting/detail"], resolve),
        name: "priceSettingDetail",
        meta: { title: "包车价格设置详情", activeMenu: "/charteredBus/priceSetting" },
      },
    ],
  },



  {
    path: "/tool",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "build/index",
        component: (resolve) => require(["@/views/tool/build"], resolve),
        name: "FormBuild",
        meta: { title: "表单配置", icon: "" },
      },
    ],
  },
  {
    // 反欺诈
    path: "/risk/credit",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "add",
        component: (resolve) =>
          require(["@/views/risk/credit/add"], resolve),
        name: "creditAdd",
        meta: { title: "征信查询", icon: '' },
      },
      {
        path: "detail",
        component: (resolve) =>
          require(["@/views/risk/credit/detail"], resolve),
        name: "creditDetail",
        meta: { title: "反欺诈详情", icon: '' },
      },
    ],
  },
  {
    // 征信包详情
    path: "/system/credit",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/packageDetail/:id",
        component: (resolve) =>
          require(["@/views/system/credit/packageDetail"], resolve),
        name: "packageDetail",
        meta: { title: "征信包详情", icon: '' },
      }
    ],
  },
  {
    // 账号管理
    path: "/risk/illegal",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "account",
        component: (resolve) =>
          require(["@/views/risk/illegal/account"], resolve),
        name: "Account",
        meta: { title: "账号管理", activeMenu: "/car/illegal" },
      },
    ],
  },
  {
    // 电子合同
    path: "/electronicContract",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/enterpriseCertification/add",
        component: (resolve) =>
          require(["@/views/electronicContract/enterpriseCertification/add"], resolve),
        name: "addEnterprise",
        meta: { title: "新增企业认证" },
      },
      {
        path: "/enterpriseCertification/detail",
        component: (resolve) =>
          require(["@/views/electronicContract/enterpriseCertification/detail"], resolve),
        name: "centerpriseCertificationDetail",
        meta: { title: "企业详情" },
      },
      {
        path: "/contractTemplate/add",
        component: (resolve) =>
          require(["@/views/electronicContract/contractTemplate/add"], resolve),
        name: "addContractTemplate",
        meta: { title: "新增合同模板" },
      },
      {
        path: "/contractList/detail",
        component: (resolve) =>
          require(["@/views/electronicContract/contractList/detail"], resolve),
        name: "contractDetail",
        meta: { title: "合同详情" },
      },
      {
        path: "/contractTemplate/detail",
        component: (resolve) =>
          require(["@/views/electronicContract/contractTemplate/detail"], resolve),
        name: "contractTemplateDetail",
        meta: { title: "合同模板详情" },
      }
    ],
  }, {
    // 数据大屏
    path: "/shujudaping",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "account",
        component: (resolve) =>
          require(["@/views/shujudaping/largeScreen"], resolve),
        name: "Shujudaping",
        meta: { title: "数据大屏", activeMenu: "/car/illegal" },
      },
    ],
  },
  {
    // 新增电子围栏
    path: "/pence",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "add",
        component: (resolve) =>
          require(["@/views/car/pence/addPence"], resolve),
        name: "AddPence",
        meta: { title: "新增电子围栏", activeMenu: "/car/illegal",keepAlive: false },
      },
      {
        path: "edit",
        component: (resolve) =>
          require(["@/views/car/pence/editPence"], resolve),
        name: "AddPence",
        meta: { title: "修改电子围栏", activeMenu: "/car/illegal",keepAlive: false },
      },
      {
        path: "info",
        component: (resolve) =>
          require(["@/views/car/pence/inforPence"], resolve),
        name: "AddPence",
        meta: { title: "电子围栏详情", activeMenu: "/car/illegal",keepAlive: false },
      },
    ],
  },

];

export default new Router({
  // mode: "history", // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes,
});
